<?php
/**
 * This is LilBlogs's core configuration file.
 *
 * Don not modify this file directly. Override or set your configuration directives in 
 * APP/config/config.php.
 *
 * @copyright     Copyright 2008-2010, LilCake.net
 * @link          http://lilcake.net LilCake.net
 * @package       lil.plugins.lil_blogs
 * @subpackage    lil.plugins.lil_blogs.config
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
	Configure::write('LilBlogs.excerptDelimiter', '<!-- MORE -->');
	Configure::write('LilBlogs.excerptLength', 200);
	
	Configure::write('LilBlogs.mainPageItems', 10);
	
	Configure::write('LilBlogs.rssItems', 20);
	
	// This is default blog's slug
	// When no area/blog is selected, users can still edit posts from default blog
	// if it is set.
	Configure::write('LilBlogs.defaultBlog', null);
	Configure::write('LilBlogs.defaultBlogTitle', 'Default Blog');
	
	// When allowEmptyBlog is set to true, posts can be stored without area
	Configure::write('LilBlogs.allowEmptyBlog', false);
	
	Configure::write('LilBlogs.noCategories', false);
	Configure::write('LilBlogs.noComments', false);
	
	if ($slug = Configure::read('Lil.areaSlugField')) {
		Configure::write('LilBlogs.blogSlugField', $slug);
	} else {
		Configure::write('LilBlogs.blogSlugField', 'slug');
	}
	
	Configure::write('LilBlogs.authorAssociation', array(
		'className'             => 'Lil.User',
		'foreignKey'            => 'author_id',
		'associationForeignKey' => 'blog_id',
		'type'                  => 'INNER'
	));
	
	Configure::write('LilBlogs.blogAssociation', array(
		'className'  => 'Lil.Area',
		'foreignKey' => 'blog_id',
	));
	
	Configure::write('LilBlogs.commentAssociation', array(
		'className'  => 'LilBlogs.Comment',
		'foreignKey' => 'post_id',
		'order'      => 'Comment.created'
	));
	
	Configure::write('LilBlogs.categoryAssociation', array(
		'className'             => 'LilBlogs.Category',
		'with'                  => 'LilBlogs.CategoriesPost',
		// this has to be additional for custom configuration abilities
		'withClassName'         => 'CategoriesPost',
		'foreignKey'            => 'post_id',
		'associationForeignKey' => 'category_id',
		'joinTable'             => (($prefix = Configure::read('LilBlogs.tablePrefix')) ? $prefix : '') . 'categories_posts'
	));